/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "protobufjs/minimal";

// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

export const pb = $root.pb = (() => {

    /**
     * Namespace pb.
     * @exports pb
     * @namespace
     */
    const pb = {};

    pb.Config = (function() {

        /**
         * Properties of a Config.
         * @memberof pb
         * @interface IConfig
         * @property {number|null} [port] Config port
         * @property {number|null} [webPort] Config webPort
         * @property {number|null} [grpcPort] Config grpcPort
         * @property {number|null} [defaultLimit] Config defaultLimit
         * @property {pb.ILdap|null} [ldap] Config ldap
         * @property {Array.<pb.IConn>|null} [conns] Config conns
         * @property {string|null} [path] Config path
         * @property {Array.<string>|null} [passCodes] Config passCodes
         * @property {Object.<string,string>|null} [auth] Config auth
         */

        /**
         * Constructs a new Config.
         * @memberof pb
         * @classdesc Represents a Config.
         * @implements IConfig
         * @constructor
         * @param {pb.IConfig=} [properties] Properties to set
         */
        function Config(properties) {
            this.conns = [];
            this.passCodes = [];
            this.auth = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Config port.
         * @member {number} port
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.port = 0;

        /**
         * Config webPort.
         * @member {number} webPort
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.webPort = 0;

        /**
         * Config grpcPort.
         * @member {number} grpcPort
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.grpcPort = 0;

        /**
         * Config defaultLimit.
         * @member {number} defaultLimit
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.defaultLimit = 0;

        /**
         * Config ldap.
         * @member {pb.ILdap|null|undefined} ldap
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.ldap = null;

        /**
         * Config conns.
         * @member {Array.<pb.IConn>} conns
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.conns = $util.emptyArray;

        /**
         * Config path.
         * @member {string} path
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.path = "";

        /**
         * Config passCodes.
         * @member {Array.<string>} passCodes
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.passCodes = $util.emptyArray;

        /**
         * Config auth.
         * @member {Object.<string,string>} auth
         * @memberof pb.Config
         * @instance
         */
        Config.prototype.auth = $util.emptyObject;

        /**
         * Creates a new Config instance using the specified properties.
         * @function create
         * @memberof pb.Config
         * @static
         * @param {pb.IConfig=} [properties] Properties to set
         * @returns {pb.Config} Config instance
         */
        Config.create = function create(properties) {
            return new Config(properties);
        };

        /**
         * Encodes the specified Config message. Does not implicitly {@link pb.Config.verify|verify} messages.
         * @function encode
         * @memberof pb.Config
         * @static
         * @param {pb.IConfig} message Config message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Config.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.port != null && Object.hasOwnProperty.call(message, "port"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port);
            if (message.webPort != null && Object.hasOwnProperty.call(message, "webPort"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.webPort);
            if (message.grpcPort != null && Object.hasOwnProperty.call(message, "grpcPort"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.grpcPort);
            if (message.defaultLimit != null && Object.hasOwnProperty.call(message, "defaultLimit"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaultLimit);
            if (message.ldap != null && Object.hasOwnProperty.call(message, "ldap"))
                $root.pb.Ldap.encode(message.ldap, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.conns != null && message.conns.length)
                for (let i = 0; i < message.conns.length; ++i)
                    $root.pb.Conn.encode(message.conns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            if (message.path != null && Object.hasOwnProperty.call(message, "path"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.path);
            if (message.passCodes != null && message.passCodes.length)
                for (let i = 0; i < message.passCodes.length; ++i)
                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.passCodes[i]);
            if (message.auth != null && Object.hasOwnProperty.call(message, "auth"))
                for (let keys = Object.keys(message.auth), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.auth[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Config message, length delimited. Does not implicitly {@link pb.Config.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Config
         * @static
         * @param {pb.IConfig} message Config message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Config.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Config message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Config
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Config} Config
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Config.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Config(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.port = reader.int32();
                    break;
                case 2:
                    message.webPort = reader.int32();
                    break;
                case 3:
                    message.grpcPort = reader.int32();
                    break;
                case 4:
                    message.defaultLimit = reader.int32();
                    break;
                case 5:
                    message.ldap = $root.pb.Ldap.decode(reader, reader.uint32());
                    break;
                case 6:
                    if (!(message.conns && message.conns.length))
                        message.conns = [];
                    message.conns.push($root.pb.Conn.decode(reader, reader.uint32()));
                    break;
                case 7:
                    message.path = reader.string();
                    break;
                case 8:
                    if (!(message.passCodes && message.passCodes.length))
                        message.passCodes = [];
                    message.passCodes.push(reader.string());
                    break;
                case 9:
                    if (message.auth === $util.emptyObject)
                        message.auth = {};
                    let end2 = reader.uint32() + reader.pos;
                    key = "";
                    value = "";
                    while (reader.pos < end2) {
                        let tag2 = reader.uint32();
                        switch (tag2 >>> 3) {
                        case 1:
                            key = reader.string();
                            break;
                        case 2:
                            value = reader.string();
                            break;
                        default:
                            reader.skipType(tag2 & 7);
                            break;
                        }
                    }
                    message.auth[key] = value;
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Config message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Config
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Config} Config
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Config.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Config message.
         * @function verify
         * @memberof pb.Config
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Config.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.port != null && message.hasOwnProperty("port"))
                if (!$util.isInteger(message.port))
                    return "port: integer expected";
            if (message.webPort != null && message.hasOwnProperty("webPort"))
                if (!$util.isInteger(message.webPort))
                    return "webPort: integer expected";
            if (message.grpcPort != null && message.hasOwnProperty("grpcPort"))
                if (!$util.isInteger(message.grpcPort))
                    return "grpcPort: integer expected";
            if (message.defaultLimit != null && message.hasOwnProperty("defaultLimit"))
                if (!$util.isInteger(message.defaultLimit))
                    return "defaultLimit: integer expected";
            if (message.ldap != null && message.hasOwnProperty("ldap")) {
                let error = $root.pb.Ldap.verify(message.ldap);
                if (error)
                    return "ldap." + error;
            }
            if (message.conns != null && message.hasOwnProperty("conns")) {
                if (!Array.isArray(message.conns))
                    return "conns: array expected";
                for (let i = 0; i < message.conns.length; ++i) {
                    let error = $root.pb.Conn.verify(message.conns[i]);
                    if (error)
                        return "conns." + error;
                }
            }
            if (message.path != null && message.hasOwnProperty("path"))
                if (!$util.isString(message.path))
                    return "path: string expected";
            if (message.passCodes != null && message.hasOwnProperty("passCodes")) {
                if (!Array.isArray(message.passCodes))
                    return "passCodes: array expected";
                for (let i = 0; i < message.passCodes.length; ++i)
                    if (!$util.isString(message.passCodes[i]))
                        return "passCodes: string[] expected";
            }
            if (message.auth != null && message.hasOwnProperty("auth")) {
                if (!$util.isObject(message.auth))
                    return "auth: object expected";
                let key = Object.keys(message.auth);
                for (let i = 0; i < key.length; ++i)
                    if (!$util.isString(message.auth[key[i]]))
                        return "auth: string{k:string} expected";
            }
            return null;
        };

        /**
         * Creates a Config message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Config
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Config} Config
         */
        Config.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Config)
                return object;
            let message = new $root.pb.Config();
            if (object.port != null)
                message.port = object.port | 0;
            if (object.webPort != null)
                message.webPort = object.webPort | 0;
            if (object.grpcPort != null)
                message.grpcPort = object.grpcPort | 0;
            if (object.defaultLimit != null)
                message.defaultLimit = object.defaultLimit | 0;
            if (object.ldap != null) {
                if (typeof object.ldap !== "object")
                    throw TypeError(".pb.Config.ldap: object expected");
                message.ldap = $root.pb.Ldap.fromObject(object.ldap);
            }
            if (object.conns) {
                if (!Array.isArray(object.conns))
                    throw TypeError(".pb.Config.conns: array expected");
                message.conns = [];
                for (let i = 0; i < object.conns.length; ++i) {
                    if (typeof object.conns[i] !== "object")
                        throw TypeError(".pb.Config.conns: object expected");
                    message.conns[i] = $root.pb.Conn.fromObject(object.conns[i]);
                }
            }
            if (object.path != null)
                message.path = String(object.path);
            if (object.passCodes) {
                if (!Array.isArray(object.passCodes))
                    throw TypeError(".pb.Config.passCodes: array expected");
                message.passCodes = [];
                for (let i = 0; i < object.passCodes.length; ++i)
                    message.passCodes[i] = String(object.passCodes[i]);
            }
            if (object.auth) {
                if (typeof object.auth !== "object")
                    throw TypeError(".pb.Config.auth: object expected");
                message.auth = {};
                for (let keys = Object.keys(object.auth), i = 0; i < keys.length; ++i)
                    message.auth[keys[i]] = String(object.auth[keys[i]]);
            }
            return message;
        };

        /**
         * Creates a plain object from a Config message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Config
         * @static
         * @param {pb.Config} message Config
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Config.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.conns = [];
                object.passCodes = [];
            }
            if (options.objects || options.defaults)
                object.auth = {};
            if (options.defaults) {
                object.port = 0;
                object.webPort = 0;
                object.grpcPort = 0;
                object.defaultLimit = 0;
                object.ldap = null;
                object.path = "";
            }
            if (message.port != null && message.hasOwnProperty("port"))
                object.port = message.port;
            if (message.webPort != null && message.hasOwnProperty("webPort"))
                object.webPort = message.webPort;
            if (message.grpcPort != null && message.hasOwnProperty("grpcPort"))
                object.grpcPort = message.grpcPort;
            if (message.defaultLimit != null && message.hasOwnProperty("defaultLimit"))
                object.defaultLimit = message.defaultLimit;
            if (message.ldap != null && message.hasOwnProperty("ldap"))
                object.ldap = $root.pb.Ldap.toObject(message.ldap, options);
            if (message.conns && message.conns.length) {
                object.conns = [];
                for (let j = 0; j < message.conns.length; ++j)
                    object.conns[j] = $root.pb.Conn.toObject(message.conns[j], options);
            }
            if (message.path != null && message.hasOwnProperty("path"))
                object.path = message.path;
            if (message.passCodes && message.passCodes.length) {
                object.passCodes = [];
                for (let j = 0; j < message.passCodes.length; ++j)
                    object.passCodes[j] = message.passCodes[j];
            }
            let keys2;
            if (message.auth && (keys2 = Object.keys(message.auth)).length) {
                object.auth = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.auth[keys2[j]] = message.auth[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this Config to JSON.
         * @function toJSON
         * @memberof pb.Config
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Config.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Config;
    })();

    pb.Conn = (function() {

        /**
         * Properties of a Conn.
         * @memberof pb
         * @interface IConn
         * @property {number|null} [id] Conn id
         * @property {string|null} [name] Conn name
         * @property {pb.ConnType|null} [type] Conn type
         * @property {string|null} [address] Conn address
         * @property {string|null} [username] Conn username
         * @property {string|null} [password] Conn password
         * @property {string|null} [schema] Conn schema
         * @property {string|null} [charset] Conn charset
         * @property {Array.<pb.IUser>|null} [users] Conn users
         */

        /**
         * Constructs a new Conn.
         * @memberof pb
         * @classdesc Represents a Conn.
         * @implements IConn
         * @constructor
         * @param {pb.IConn=} [properties] Properties to set
         */
        function Conn(properties) {
            this.users = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Conn id.
         * @member {number} id
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.id = 0;

        /**
         * Conn name.
         * @member {string} name
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.name = "";

        /**
         * Conn type.
         * @member {pb.ConnType} type
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.type = 0;

        /**
         * Conn address.
         * @member {string} address
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.address = "";

        /**
         * Conn username.
         * @member {string} username
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.username = "";

        /**
         * Conn password.
         * @member {string} password
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.password = "";

        /**
         * Conn schema.
         * @member {string} schema
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.schema = "";

        /**
         * Conn charset.
         * @member {string} charset
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.charset = "";

        /**
         * Conn users.
         * @member {Array.<pb.IUser>} users
         * @memberof pb.Conn
         * @instance
         */
        Conn.prototype.users = $util.emptyArray;

        /**
         * Creates a new Conn instance using the specified properties.
         * @function create
         * @memberof pb.Conn
         * @static
         * @param {pb.IConn=} [properties] Properties to set
         * @returns {pb.Conn} Conn instance
         */
        Conn.create = function create(properties) {
            return new Conn(properties);
        };

        /**
         * Encodes the specified Conn message. Does not implicitly {@link pb.Conn.verify|verify} messages.
         * @function encode
         * @memberof pb.Conn
         * @static
         * @param {pb.IConn} message Conn message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Conn.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.id);
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.address);
            if (message.username != null && Object.hasOwnProperty.call(message, "username"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.username);
            if (message.password != null && Object.hasOwnProperty.call(message, "password"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.password);
            if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.schema);
            if (message.charset != null && Object.hasOwnProperty.call(message, "charset"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.charset);
            if (message.users != null && message.users.length)
                for (let i = 0; i < message.users.length; ++i)
                    $root.pb.User.encode(message.users[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Conn message, length delimited. Does not implicitly {@link pb.Conn.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Conn
         * @static
         * @param {pb.IConn} message Conn message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Conn.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Conn message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Conn
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Conn} Conn
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Conn.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Conn();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.uint32();
                    break;
                case 2:
                    message.name = reader.string();
                    break;
                case 3:
                    message.type = reader.int32();
                    break;
                case 4:
                    message.address = reader.string();
                    break;
                case 5:
                    message.username = reader.string();
                    break;
                case 6:
                    message.password = reader.string();
                    break;
                case 7:
                    message.schema = reader.string();
                    break;
                case 8:
                    message.charset = reader.string();
                    break;
                case 9:
                    if (!(message.users && message.users.length))
                        message.users = [];
                    message.users.push($root.pb.User.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Conn message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Conn
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Conn} Conn
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Conn.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Conn message.
         * @function verify
         * @memberof pb.Conn
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Conn.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                    break;
                }
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            if (message.username != null && message.hasOwnProperty("username"))
                if (!$util.isString(message.username))
                    return "username: string expected";
            if (message.password != null && message.hasOwnProperty("password"))
                if (!$util.isString(message.password))
                    return "password: string expected";
            if (message.schema != null && message.hasOwnProperty("schema"))
                if (!$util.isString(message.schema))
                    return "schema: string expected";
            if (message.charset != null && message.hasOwnProperty("charset"))
                if (!$util.isString(message.charset))
                    return "charset: string expected";
            if (message.users != null && message.hasOwnProperty("users")) {
                if (!Array.isArray(message.users))
                    return "users: array expected";
                for (let i = 0; i < message.users.length; ++i) {
                    let error = $root.pb.User.verify(message.users[i]);
                    if (error)
                        return "users." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Conn message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Conn
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Conn} Conn
         */
        Conn.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Conn)
                return object;
            let message = new $root.pb.Conn();
            if (object.id != null)
                message.id = object.id >>> 0;
            if (object.name != null)
                message.name = String(object.name);
            switch (object.type) {
            case "Mysql":
            case 0:
                message.type = 0;
                break;
            case "Grpc":
            case 1:
                message.type = 1;
                break;
            }
            if (object.address != null)
                message.address = String(object.address);
            if (object.username != null)
                message.username = String(object.username);
            if (object.password != null)
                message.password = String(object.password);
            if (object.schema != null)
                message.schema = String(object.schema);
            if (object.charset != null)
                message.charset = String(object.charset);
            if (object.users) {
                if (!Array.isArray(object.users))
                    throw TypeError(".pb.Conn.users: array expected");
                message.users = [];
                for (let i = 0; i < object.users.length; ++i) {
                    if (typeof object.users[i] !== "object")
                        throw TypeError(".pb.Conn.users: object expected");
                    message.users[i] = $root.pb.User.fromObject(object.users[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Conn message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Conn
         * @static
         * @param {pb.Conn} message Conn
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Conn.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.users = [];
            if (options.defaults) {
                object.id = 0;
                object.name = "";
                object.type = options.enums === String ? "Mysql" : 0;
                object.address = "";
                object.username = "";
                object.password = "";
                object.schema = "";
                object.charset = "";
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.pb.ConnType[message.type] : message.type;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            if (message.username != null && message.hasOwnProperty("username"))
                object.username = message.username;
            if (message.password != null && message.hasOwnProperty("password"))
                object.password = message.password;
            if (message.schema != null && message.hasOwnProperty("schema"))
                object.schema = message.schema;
            if (message.charset != null && message.hasOwnProperty("charset"))
                object.charset = message.charset;
            if (message.users && message.users.length) {
                object.users = [];
                for (let j = 0; j < message.users.length; ++j)
                    object.users[j] = $root.pb.User.toObject(message.users[j], options);
            }
            return object;
        };

        /**
         * Converts this Conn to JSON.
         * @function toJSON
         * @memberof pb.Conn
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Conn.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Conn;
    })();

    /**
     * ConnType enum.
     * @name pb.ConnType
     * @enum {number}
     * @property {number} Mysql=0 Mysql value
     * @property {number} Grpc=1 Grpc value
     */
    pb.ConnType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "Mysql"] = 0;
        values[valuesById[1] = "Grpc"] = 1;
        return values;
    })();

    pb.Ldap = (function() {

        /**
         * Properties of a Ldap.
         * @memberof pb
         * @interface ILdap
         * @property {string|null} [url] Ldap url
         * @property {boolean|null} [ldaps] Ldap ldaps
         * @property {string|null} [user] Ldap user
         * @property {string|null} [password] Ldap password
         * @property {string|null} [sc] Ldap sc
         * @property {string|null} [filter] Ldap filter
         */

        /**
         * Constructs a new Ldap.
         * @memberof pb
         * @classdesc Represents a Ldap.
         * @implements ILdap
         * @constructor
         * @param {pb.ILdap=} [properties] Properties to set
         */
        function Ldap(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Ldap url.
         * @member {string} url
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.url = "";

        /**
         * Ldap ldaps.
         * @member {boolean} ldaps
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.ldaps = false;

        /**
         * Ldap user.
         * @member {string} user
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.user = "";

        /**
         * Ldap password.
         * @member {string} password
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.password = "";

        /**
         * Ldap sc.
         * @member {string} sc
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.sc = "";

        /**
         * Ldap filter.
         * @member {string} filter
         * @memberof pb.Ldap
         * @instance
         */
        Ldap.prototype.filter = "";

        /**
         * Creates a new Ldap instance using the specified properties.
         * @function create
         * @memberof pb.Ldap
         * @static
         * @param {pb.ILdap=} [properties] Properties to set
         * @returns {pb.Ldap} Ldap instance
         */
        Ldap.create = function create(properties) {
            return new Ldap(properties);
        };

        /**
         * Encodes the specified Ldap message. Does not implicitly {@link pb.Ldap.verify|verify} messages.
         * @function encode
         * @memberof pb.Ldap
         * @static
         * @param {pb.ILdap} message Ldap message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Ldap.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.url != null && Object.hasOwnProperty.call(message, "url"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.url);
            if (message.ldaps != null && Object.hasOwnProperty.call(message, "ldaps"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ldaps);
            if (message.user != null && Object.hasOwnProperty.call(message, "user"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.user);
            if (message.password != null && Object.hasOwnProperty.call(message, "password"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.password);
            if (message.sc != null && Object.hasOwnProperty.call(message, "sc"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.sc);
            if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.filter);
            return writer;
        };

        /**
         * Encodes the specified Ldap message, length delimited. Does not implicitly {@link pb.Ldap.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Ldap
         * @static
         * @param {pb.ILdap} message Ldap message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Ldap.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Ldap message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Ldap
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Ldap} Ldap
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Ldap.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Ldap();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.url = reader.string();
                    break;
                case 2:
                    message.ldaps = reader.bool();
                    break;
                case 3:
                    message.user = reader.string();
                    break;
                case 4:
                    message.password = reader.string();
                    break;
                case 5:
                    message.sc = reader.string();
                    break;
                case 6:
                    message.filter = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Ldap message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Ldap
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Ldap} Ldap
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Ldap.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Ldap message.
         * @function verify
         * @memberof pb.Ldap
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Ldap.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.url != null && message.hasOwnProperty("url"))
                if (!$util.isString(message.url))
                    return "url: string expected";
            if (message.ldaps != null && message.hasOwnProperty("ldaps"))
                if (typeof message.ldaps !== "boolean")
                    return "ldaps: boolean expected";
            if (message.user != null && message.hasOwnProperty("user"))
                if (!$util.isString(message.user))
                    return "user: string expected";
            if (message.password != null && message.hasOwnProperty("password"))
                if (!$util.isString(message.password))
                    return "password: string expected";
            if (message.sc != null && message.hasOwnProperty("sc"))
                if (!$util.isString(message.sc))
                    return "sc: string expected";
            if (message.filter != null && message.hasOwnProperty("filter"))
                if (!$util.isString(message.filter))
                    return "filter: string expected";
            return null;
        };

        /**
         * Creates a Ldap message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Ldap
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Ldap} Ldap
         */
        Ldap.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Ldap)
                return object;
            let message = new $root.pb.Ldap();
            if (object.url != null)
                message.url = String(object.url);
            if (object.ldaps != null)
                message.ldaps = Boolean(object.ldaps);
            if (object.user != null)
                message.user = String(object.user);
            if (object.password != null)
                message.password = String(object.password);
            if (object.sc != null)
                message.sc = String(object.sc);
            if (object.filter != null)
                message.filter = String(object.filter);
            return message;
        };

        /**
         * Creates a plain object from a Ldap message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Ldap
         * @static
         * @param {pb.Ldap} message Ldap
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Ldap.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.url = "";
                object.ldaps = false;
                object.user = "";
                object.password = "";
                object.sc = "";
                object.filter = "";
            }
            if (message.url != null && message.hasOwnProperty("url"))
                object.url = message.url;
            if (message.ldaps != null && message.hasOwnProperty("ldaps"))
                object.ldaps = message.ldaps;
            if (message.user != null && message.hasOwnProperty("user"))
                object.user = message.user;
            if (message.password != null && message.hasOwnProperty("password"))
                object.password = message.password;
            if (message.sc != null && message.hasOwnProperty("sc"))
                object.sc = message.sc;
            if (message.filter != null && message.hasOwnProperty("filter"))
                object.filter = message.filter;
            return object;
        };

        /**
         * Converts this Ldap to JSON.
         * @function toJSON
         * @memberof pb.Ldap
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Ldap.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Ldap;
    })();

    pb.Rule = (function() {

        /**
         * Properties of a Rule.
         * @memberof pb
         * @interface IRule
         * @property {string|null} [item] Rule item
         * @property {string|null} [severity] Rule severity
         * @property {string|null} [summary] Rule summary
         * @property {string|null} [content] Rule content
         * @property {string|null} ["case"] Rule case
         * @property {number|null} [position] Rule position
         */

        /**
         * Constructs a new Rule.
         * @memberof pb
         * @classdesc Represents a Rule.
         * @implements IRule
         * @constructor
         * @param {pb.IRule=} [properties] Properties to set
         */
        function Rule(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Rule item.
         * @member {string} item
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype.item = "";

        /**
         * Rule severity.
         * @member {string} severity
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype.severity = "";

        /**
         * Rule summary.
         * @member {string} summary
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype.summary = "";

        /**
         * Rule content.
         * @member {string} content
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype.content = "";

        /**
         * Rule case.
         * @member {string} case
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype["case"] = "";

        /**
         * Rule position.
         * @member {number} position
         * @memberof pb.Rule
         * @instance
         */
        Rule.prototype.position = 0;

        /**
         * Creates a new Rule instance using the specified properties.
         * @function create
         * @memberof pb.Rule
         * @static
         * @param {pb.IRule=} [properties] Properties to set
         * @returns {pb.Rule} Rule instance
         */
        Rule.create = function create(properties) {
            return new Rule(properties);
        };

        /**
         * Encodes the specified Rule message. Does not implicitly {@link pb.Rule.verify|verify} messages.
         * @function encode
         * @memberof pb.Rule
         * @static
         * @param {pb.IRule} message Rule message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Rule.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.item != null && Object.hasOwnProperty.call(message, "item"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.item);
            if (message.severity != null && Object.hasOwnProperty.call(message, "severity"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.severity);
            if (message.summary != null && Object.hasOwnProperty.call(message, "summary"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.summary);
            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.content);
            if (message["case"] != null && Object.hasOwnProperty.call(message, "case"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message["case"]);
            if (message.position != null && Object.hasOwnProperty.call(message, "position"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.position);
            return writer;
        };

        /**
         * Encodes the specified Rule message, length delimited. Does not implicitly {@link pb.Rule.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Rule
         * @static
         * @param {pb.IRule} message Rule message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Rule.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Rule message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Rule
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Rule} Rule
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Rule.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Rule();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 3:
                    message.item = reader.string();
                    break;
                case 4:
                    message.severity = reader.string();
                    break;
                case 5:
                    message.summary = reader.string();
                    break;
                case 6:
                    message.content = reader.string();
                    break;
                case 7:
                    message["case"] = reader.string();
                    break;
                case 8:
                    message.position = reader.uint32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Rule message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Rule
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Rule} Rule
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Rule.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Rule message.
         * @function verify
         * @memberof pb.Rule
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Rule.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.item != null && message.hasOwnProperty("item"))
                if (!$util.isString(message.item))
                    return "item: string expected";
            if (message.severity != null && message.hasOwnProperty("severity"))
                if (!$util.isString(message.severity))
                    return "severity: string expected";
            if (message.summary != null && message.hasOwnProperty("summary"))
                if (!$util.isString(message.summary))
                    return "summary: string expected";
            if (message.content != null && message.hasOwnProperty("content"))
                if (!$util.isString(message.content))
                    return "content: string expected";
            if (message["case"] != null && message.hasOwnProperty("case"))
                if (!$util.isString(message["case"]))
                    return "case: string expected";
            if (message.position != null && message.hasOwnProperty("position"))
                if (!$util.isInteger(message.position))
                    return "position: integer expected";
            return null;
        };

        /**
         * Creates a Rule message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Rule
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Rule} Rule
         */
        Rule.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Rule)
                return object;
            let message = new $root.pb.Rule();
            if (object.item != null)
                message.item = String(object.item);
            if (object.severity != null)
                message.severity = String(object.severity);
            if (object.summary != null)
                message.summary = String(object.summary);
            if (object.content != null)
                message.content = String(object.content);
            if (object["case"] != null)
                message["case"] = String(object["case"]);
            if (object.position != null)
                message.position = object.position >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a Rule message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Rule
         * @static
         * @param {pb.Rule} message Rule
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Rule.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.item = "";
                object.severity = "";
                object.summary = "";
                object.content = "";
                object["case"] = "";
                object.position = 0;
            }
            if (message.item != null && message.hasOwnProperty("item"))
                object.item = message.item;
            if (message.severity != null && message.hasOwnProperty("severity"))
                object.severity = message.severity;
            if (message.summary != null && message.hasOwnProperty("summary"))
                object.summary = message.summary;
            if (message.content != null && message.hasOwnProperty("content"))
                object.content = message.content;
            if (message["case"] != null && message.hasOwnProperty("case"))
                object["case"] = message["case"];
            if (message.position != null && message.hasOwnProperty("position"))
                object.position = message.position;
            return object;
        };

        /**
         * Converts this Rule to JSON.
         * @function toJSON
         * @memberof pb.Rule
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Rule.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Rule;
    })();

    pb.Log = (function() {

        /**
         * Properties of a Log.
         * @memberof pb
         * @interface ILog
         * @property {number|null} [finger] Log finger
         * @property {string|null} [sql] Log sql
         * @property {number|null} [timeStamp] Log timeStamp
         * @property {Array.<pb.IRule>|null} [rules] Log rules
         * @property {number|null} [count] Log count
         */

        /**
         * Constructs a new Log.
         * @memberof pb
         * @classdesc Represents a Log.
         * @implements ILog
         * @constructor
         * @param {pb.ILog=} [properties] Properties to set
         */
        function Log(properties) {
            this.rules = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Log finger.
         * @member {number} finger
         * @memberof pb.Log
         * @instance
         */
        Log.prototype.finger = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Log sql.
         * @member {string} sql
         * @memberof pb.Log
         * @instance
         */
        Log.prototype.sql = "";

        /**
         * Log timeStamp.
         * @member {number} timeStamp
         * @memberof pb.Log
         * @instance
         */
        Log.prototype.timeStamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Log rules.
         * @member {Array.<pb.IRule>} rules
         * @memberof pb.Log
         * @instance
         */
        Log.prototype.rules = $util.emptyArray;

        /**
         * Log count.
         * @member {number} count
         * @memberof pb.Log
         * @instance
         */
        Log.prototype.count = 0;

        /**
         * Creates a new Log instance using the specified properties.
         * @function create
         * @memberof pb.Log
         * @static
         * @param {pb.ILog=} [properties] Properties to set
         * @returns {pb.Log} Log instance
         */
        Log.create = function create(properties) {
            return new Log(properties);
        };

        /**
         * Encodes the specified Log message. Does not implicitly {@link pb.Log.verify|verify} messages.
         * @function encode
         * @memberof pb.Log
         * @static
         * @param {pb.ILog} message Log message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Log.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.finger != null && Object.hasOwnProperty.call(message, "finger"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.finger);
            if (message.sql != null && Object.hasOwnProperty.call(message, "sql"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.sql);
            if (message.timeStamp != null && Object.hasOwnProperty.call(message, "timeStamp"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timeStamp);
            if (message.rules != null && message.rules.length)
                for (let i = 0; i < message.rules.length; ++i)
                    $root.pb.Rule.encode(message.rules[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.count != null && Object.hasOwnProperty.call(message, "count"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count);
            return writer;
        };

        /**
         * Encodes the specified Log message, length delimited. Does not implicitly {@link pb.Log.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Log
         * @static
         * @param {pb.ILog} message Log message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Log.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Log message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Log
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Log} Log
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Log.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Log();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.finger = reader.uint64();
                    break;
                case 2:
                    message.sql = reader.string();
                    break;
                case 3:
                    message.timeStamp = reader.int64();
                    break;
                case 4:
                    if (!(message.rules && message.rules.length))
                        message.rules = [];
                    message.rules.push($root.pb.Rule.decode(reader, reader.uint32()));
                    break;
                case 5:
                    message.count = reader.uint32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Log message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Log
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Log} Log
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Log.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Log message.
         * @function verify
         * @memberof pb.Log
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Log.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.finger != null && message.hasOwnProperty("finger"))
                if (!$util.isInteger(message.finger) && !(message.finger && $util.isInteger(message.finger.low) && $util.isInteger(message.finger.high)))
                    return "finger: integer|Long expected";
            if (message.sql != null && message.hasOwnProperty("sql"))
                if (!$util.isString(message.sql))
                    return "sql: string expected";
            if (message.timeStamp != null && message.hasOwnProperty("timeStamp"))
                if (!$util.isInteger(message.timeStamp) && !(message.timeStamp && $util.isInteger(message.timeStamp.low) && $util.isInteger(message.timeStamp.high)))
                    return "timeStamp: integer|Long expected";
            if (message.rules != null && message.hasOwnProperty("rules")) {
                if (!Array.isArray(message.rules))
                    return "rules: array expected";
                for (let i = 0; i < message.rules.length; ++i) {
                    let error = $root.pb.Rule.verify(message.rules[i]);
                    if (error)
                        return "rules." + error;
                }
            }
            if (message.count != null && message.hasOwnProperty("count"))
                if (!$util.isInteger(message.count))
                    return "count: integer expected";
            return null;
        };

        /**
         * Creates a Log message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Log
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Log} Log
         */
        Log.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Log)
                return object;
            let message = new $root.pb.Log();
            if (object.finger != null)
                if ($util.Long)
                    (message.finger = $util.Long.fromValue(object.finger)).unsigned = true;
                else if (typeof object.finger === "string")
                    message.finger = parseInt(object.finger, 10);
                else if (typeof object.finger === "number")
                    message.finger = object.finger;
                else if (typeof object.finger === "object")
                    message.finger = new $util.LongBits(object.finger.low >>> 0, object.finger.high >>> 0).toNumber(true);
            if (object.sql != null)
                message.sql = String(object.sql);
            if (object.timeStamp != null)
                if ($util.Long)
                    (message.timeStamp = $util.Long.fromValue(object.timeStamp)).unsigned = false;
                else if (typeof object.timeStamp === "string")
                    message.timeStamp = parseInt(object.timeStamp, 10);
                else if (typeof object.timeStamp === "number")
                    message.timeStamp = object.timeStamp;
                else if (typeof object.timeStamp === "object")
                    message.timeStamp = new $util.LongBits(object.timeStamp.low >>> 0, object.timeStamp.high >>> 0).toNumber();
            if (object.rules) {
                if (!Array.isArray(object.rules))
                    throw TypeError(".pb.Log.rules: array expected");
                message.rules = [];
                for (let i = 0; i < object.rules.length; ++i) {
                    if (typeof object.rules[i] !== "object")
                        throw TypeError(".pb.Log.rules: object expected");
                    message.rules[i] = $root.pb.Rule.fromObject(object.rules[i]);
                }
            }
            if (object.count != null)
                message.count = object.count >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a Log message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Log
         * @static
         * @param {pb.Log} message Log
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Log.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.rules = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.finger = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.finger = options.longs === String ? "0" : 0;
                object.sql = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.timeStamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timeStamp = options.longs === String ? "0" : 0;
                object.count = 0;
            }
            if (message.finger != null && message.hasOwnProperty("finger"))
                if (typeof message.finger === "number")
                    object.finger = options.longs === String ? String(message.finger) : message.finger;
                else
                    object.finger = options.longs === String ? $util.Long.prototype.toString.call(message.finger) : options.longs === Number ? new $util.LongBits(message.finger.low >>> 0, message.finger.high >>> 0).toNumber(true) : message.finger;
            if (message.sql != null && message.hasOwnProperty("sql"))
                object.sql = message.sql;
            if (message.timeStamp != null && message.hasOwnProperty("timeStamp"))
                if (typeof message.timeStamp === "number")
                    object.timeStamp = options.longs === String ? String(message.timeStamp) : message.timeStamp;
                else
                    object.timeStamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeStamp) : options.longs === Number ? new $util.LongBits(message.timeStamp.low >>> 0, message.timeStamp.high >>> 0).toNumber() : message.timeStamp;
            if (message.rules && message.rules.length) {
                object.rules = [];
                for (let j = 0; j < message.rules.length; ++j)
                    object.rules[j] = $root.pb.Rule.toObject(message.rules[j], options);
            }
            if (message.count != null && message.hasOwnProperty("count"))
                object.count = message.count;
            return object;
        };

        /**
         * Converts this Log to JSON.
         * @function toJSON
         * @memberof pb.Log
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Log.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Log;
    })();

    pb.Logs = (function() {

        /**
         * Properties of a Logs.
         * @memberof pb
         * @interface ILogs
         * @property {Array.<pb.ILog>|null} [logs] Logs logs
         */

        /**
         * Constructs a new Logs.
         * @memberof pb
         * @classdesc Represents a Logs.
         * @implements ILogs
         * @constructor
         * @param {pb.ILogs=} [properties] Properties to set
         */
        function Logs(properties) {
            this.logs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Logs logs.
         * @member {Array.<pb.ILog>} logs
         * @memberof pb.Logs
         * @instance
         */
        Logs.prototype.logs = $util.emptyArray;

        /**
         * Creates a new Logs instance using the specified properties.
         * @function create
         * @memberof pb.Logs
         * @static
         * @param {pb.ILogs=} [properties] Properties to set
         * @returns {pb.Logs} Logs instance
         */
        Logs.create = function create(properties) {
            return new Logs(properties);
        };

        /**
         * Encodes the specified Logs message. Does not implicitly {@link pb.Logs.verify|verify} messages.
         * @function encode
         * @memberof pb.Logs
         * @static
         * @param {pb.ILogs} message Logs message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Logs.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.logs != null && message.logs.length)
                for (let i = 0; i < message.logs.length; ++i)
                    $root.pb.Log.encode(message.logs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Logs message, length delimited. Does not implicitly {@link pb.Logs.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Logs
         * @static
         * @param {pb.ILogs} message Logs message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Logs.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Logs message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Logs
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Logs} Logs
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Logs.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Logs();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 3:
                    if (!(message.logs && message.logs.length))
                        message.logs = [];
                    message.logs.push($root.pb.Log.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Logs message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Logs
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Logs} Logs
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Logs.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Logs message.
         * @function verify
         * @memberof pb.Logs
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Logs.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.logs != null && message.hasOwnProperty("logs")) {
                if (!Array.isArray(message.logs))
                    return "logs: array expected";
                for (let i = 0; i < message.logs.length; ++i) {
                    let error = $root.pb.Log.verify(message.logs[i]);
                    if (error)
                        return "logs." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Logs message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Logs
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Logs} Logs
         */
        Logs.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Logs)
                return object;
            let message = new $root.pb.Logs();
            if (object.logs) {
                if (!Array.isArray(object.logs))
                    throw TypeError(".pb.Logs.logs: array expected");
                message.logs = [];
                for (let i = 0; i < object.logs.length; ++i) {
                    if (typeof object.logs[i] !== "object")
                        throw TypeError(".pb.Logs.logs: object expected");
                    message.logs[i] = $root.pb.Log.fromObject(object.logs[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Logs message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Logs
         * @static
         * @param {pb.Logs} message Logs
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Logs.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.logs = [];
            if (message.logs && message.logs.length) {
                object.logs = [];
                for (let j = 0; j < message.logs.length; ++j)
                    object.logs[j] = $root.pb.Log.toObject(message.logs[j], options);
            }
            return object;
        };

        /**
         * Converts this Logs to JSON.
         * @function toJSON
         * @memberof pb.Logs
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Logs.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Logs;
    })();

    pb.Caller = (function() {

        /**
         * Constructs a new Caller service.
         * @memberof pb
         * @classdesc Represents a Caller
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Caller(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Caller.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Caller;

        /**
         * Creates new Caller service using the specified rpc implementation.
         * @function create
         * @memberof pb.Caller
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Caller} RPC service. Useful where requests and/or responses are streamed.
         */
        Caller.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link pb.Caller#call}.
         * @memberof pb.Caller
         * @typedef CallCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {pb.Msg} [response] Msg
         */

        /**
         * Calls Call.
         * @function call
         * @memberof pb.Caller
         * @instance
         * @param {pb.IMsg} request Msg message or plain object
         * @param {pb.Caller.CallCallback} callback Node-style callback called with the error, if any, and Msg
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Caller.prototype.call = function call(request, callback) {
            return this.rpcCall(call, $root.pb.Msg, $root.pb.Msg, request, callback);
        }, "name", { value: "Call" });

        /**
         * Calls Call.
         * @function call
         * @memberof pb.Caller
         * @instance
         * @param {pb.IMsg} request Msg message or plain object
         * @returns {Promise<pb.Msg>} Promise
         * @variation 2
         */

        return Caller;
    })();

    pb.Msg = (function() {

        /**
         * Properties of a Msg.
         * @memberof pb
         * @interface IMsg
         * @property {string|null} [sql] Msg sql
         * @property {string|null} [error] Msg error
         * @property {number|null} [insertID] Msg insertID
         * @property {number|null} [RowsAffected] Msg RowsAffected
         * @property {Array.<pb.IField>|null} [fields] Msg fields
         * @property {Array.<pb.IRow>|null} [rows] Msg rows
         */

        /**
         * Constructs a new Msg.
         * @memberof pb
         * @classdesc Represents a Msg.
         * @implements IMsg
         * @constructor
         * @param {pb.IMsg=} [properties] Properties to set
         */
        function Msg(properties) {
            this.fields = [];
            this.rows = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Msg sql.
         * @member {string} sql
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.sql = "";

        /**
         * Msg error.
         * @member {string} error
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.error = "";

        /**
         * Msg insertID.
         * @member {number} insertID
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.insertID = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Msg RowsAffected.
         * @member {number} RowsAffected
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.RowsAffected = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Msg fields.
         * @member {Array.<pb.IField>} fields
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.fields = $util.emptyArray;

        /**
         * Msg rows.
         * @member {Array.<pb.IRow>} rows
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.rows = $util.emptyArray;

        /**
         * Creates a new Msg instance using the specified properties.
         * @function create
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg=} [properties] Properties to set
         * @returns {pb.Msg} Msg instance
         */
        Msg.create = function create(properties) {
            return new Msg(properties);
        };

        /**
         * Encodes the specified Msg message. Does not implicitly {@link pb.Msg.verify|verify} messages.
         * @function encode
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg} message Msg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Msg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sql != null && Object.hasOwnProperty.call(message, "sql"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql);
            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.error);
            if (message.insertID != null && Object.hasOwnProperty.call(message, "insertID"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.insertID);
            if (message.RowsAffected != null && Object.hasOwnProperty.call(message, "RowsAffected"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.RowsAffected);
            if (message.fields != null && message.fields.length)
                for (let i = 0; i < message.fields.length; ++i)
                    $root.pb.Field.encode(message.fields[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.rows != null && message.rows.length)
                for (let i = 0; i < message.rows.length; ++i)
                    $root.pb.Row.encode(message.rows[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Msg message, length delimited. Does not implicitly {@link pb.Msg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg} message Msg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Msg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Msg message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Msg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Msg} Msg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Msg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Msg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.sql = reader.string();
                    break;
                case 2:
                    message.error = reader.string();
                    break;
                case 3:
                    message.insertID = reader.uint64();
                    break;
                case 4:
                    message.RowsAffected = reader.uint64();
                    break;
                case 5:
                    if (!(message.fields && message.fields.length))
                        message.fields = [];
                    message.fields.push($root.pb.Field.decode(reader, reader.uint32()));
                    break;
                case 6:
                    if (!(message.rows && message.rows.length))
                        message.rows = [];
                    message.rows.push($root.pb.Row.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Msg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Msg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Msg} Msg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Msg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Msg message.
         * @function verify
         * @memberof pb.Msg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Msg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sql != null && message.hasOwnProperty("sql"))
                if (!$util.isString(message.sql))
                    return "sql: string expected";
            if (message.error != null && message.hasOwnProperty("error"))
                if (!$util.isString(message.error))
                    return "error: string expected";
            if (message.insertID != null && message.hasOwnProperty("insertID"))
                if (!$util.isInteger(message.insertID) && !(message.insertID && $util.isInteger(message.insertID.low) && $util.isInteger(message.insertID.high)))
                    return "insertID: integer|Long expected";
            if (message.RowsAffected != null && message.hasOwnProperty("RowsAffected"))
                if (!$util.isInteger(message.RowsAffected) && !(message.RowsAffected && $util.isInteger(message.RowsAffected.low) && $util.isInteger(message.RowsAffected.high)))
                    return "RowsAffected: integer|Long expected";
            if (message.fields != null && message.hasOwnProperty("fields")) {
                if (!Array.isArray(message.fields))
                    return "fields: array expected";
                for (let i = 0; i < message.fields.length; ++i) {
                    let error = $root.pb.Field.verify(message.fields[i]);
                    if (error)
                        return "fields." + error;
                }
            }
            if (message.rows != null && message.hasOwnProperty("rows")) {
                if (!Array.isArray(message.rows))
                    return "rows: array expected";
                for (let i = 0; i < message.rows.length; ++i) {
                    let error = $root.pb.Row.verify(message.rows[i]);
                    if (error)
                        return "rows." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Msg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Msg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Msg} Msg
         */
        Msg.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Msg)
                return object;
            let message = new $root.pb.Msg();
            if (object.sql != null)
                message.sql = String(object.sql);
            if (object.error != null)
                message.error = String(object.error);
            if (object.insertID != null)
                if ($util.Long)
                    (message.insertID = $util.Long.fromValue(object.insertID)).unsigned = true;
                else if (typeof object.insertID === "string")
                    message.insertID = parseInt(object.insertID, 10);
                else if (typeof object.insertID === "number")
                    message.insertID = object.insertID;
                else if (typeof object.insertID === "object")
                    message.insertID = new $util.LongBits(object.insertID.low >>> 0, object.insertID.high >>> 0).toNumber(true);
            if (object.RowsAffected != null)
                if ($util.Long)
                    (message.RowsAffected = $util.Long.fromValue(object.RowsAffected)).unsigned = true;
                else if (typeof object.RowsAffected === "string")
                    message.RowsAffected = parseInt(object.RowsAffected, 10);
                else if (typeof object.RowsAffected === "number")
                    message.RowsAffected = object.RowsAffected;
                else if (typeof object.RowsAffected === "object")
                    message.RowsAffected = new $util.LongBits(object.RowsAffected.low >>> 0, object.RowsAffected.high >>> 0).toNumber(true);
            if (object.fields) {
                if (!Array.isArray(object.fields))
                    throw TypeError(".pb.Msg.fields: array expected");
                message.fields = [];
                for (let i = 0; i < object.fields.length; ++i) {
                    if (typeof object.fields[i] !== "object")
                        throw TypeError(".pb.Msg.fields: object expected");
                    message.fields[i] = $root.pb.Field.fromObject(object.fields[i]);
                }
            }
            if (object.rows) {
                if (!Array.isArray(object.rows))
                    throw TypeError(".pb.Msg.rows: array expected");
                message.rows = [];
                for (let i = 0; i < object.rows.length; ++i) {
                    if (typeof object.rows[i] !== "object")
                        throw TypeError(".pb.Msg.rows: object expected");
                    message.rows[i] = $root.pb.Row.fromObject(object.rows[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Msg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Msg
         * @static
         * @param {pb.Msg} message Msg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Msg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.fields = [];
                object.rows = [];
            }
            if (options.defaults) {
                object.sql = "";
                object.error = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.insertID = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.insertID = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.RowsAffected = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.RowsAffected = options.longs === String ? "0" : 0;
            }
            if (message.sql != null && message.hasOwnProperty("sql"))
                object.sql = message.sql;
            if (message.error != null && message.hasOwnProperty("error"))
                object.error = message.error;
            if (message.insertID != null && message.hasOwnProperty("insertID"))
                if (typeof message.insertID === "number")
                    object.insertID = options.longs === String ? String(message.insertID) : message.insertID;
                else
                    object.insertID = options.longs === String ? $util.Long.prototype.toString.call(message.insertID) : options.longs === Number ? new $util.LongBits(message.insertID.low >>> 0, message.insertID.high >>> 0).toNumber(true) : message.insertID;
            if (message.RowsAffected != null && message.hasOwnProperty("RowsAffected"))
                if (typeof message.RowsAffected === "number")
                    object.RowsAffected = options.longs === String ? String(message.RowsAffected) : message.RowsAffected;
                else
                    object.RowsAffected = options.longs === String ? $util.Long.prototype.toString.call(message.RowsAffected) : options.longs === Number ? new $util.LongBits(message.RowsAffected.low >>> 0, message.RowsAffected.high >>> 0).toNumber(true) : message.RowsAffected;
            if (message.fields && message.fields.length) {
                object.fields = [];
                for (let j = 0; j < message.fields.length; ++j)
                    object.fields[j] = $root.pb.Field.toObject(message.fields[j], options);
            }
            if (message.rows && message.rows.length) {
                object.rows = [];
                for (let j = 0; j < message.rows.length; ++j)
                    object.rows[j] = $root.pb.Row.toObject(message.rows[j], options);
            }
            return object;
        };

        /**
         * Converts this Msg to JSON.
         * @function toJSON
         * @memberof pb.Msg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Msg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Msg;
    })();

    pb.Field = (function() {

        /**
         * Properties of a Field.
         * @memberof pb
         * @interface IField
         * @property {string|null} [name] Field name
         * @property {number|null} [type] Field type
         */

        /**
         * Constructs a new Field.
         * @memberof pb
         * @classdesc Represents a Field.
         * @implements IField
         * @constructor
         * @param {pb.IField=} [properties] Properties to set
         */
        function Field(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Field name.
         * @member {string} name
         * @memberof pb.Field
         * @instance
         */
        Field.prototype.name = "";

        /**
         * Field type.
         * @member {number} type
         * @memberof pb.Field
         * @instance
         */
        Field.prototype.type = 0;

        /**
         * Creates a new Field instance using the specified properties.
         * @function create
         * @memberof pb.Field
         * @static
         * @param {pb.IField=} [properties] Properties to set
         * @returns {pb.Field} Field instance
         */
        Field.create = function create(properties) {
            return new Field(properties);
        };

        /**
         * Encodes the specified Field message. Does not implicitly {@link pb.Field.verify|verify} messages.
         * @function encode
         * @memberof pb.Field
         * @static
         * @param {pb.IField} message Field message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Field.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
            return writer;
        };

        /**
         * Encodes the specified Field message, length delimited. Does not implicitly {@link pb.Field.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Field
         * @static
         * @param {pb.IField} message Field message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Field.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Field message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Field
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Field} Field
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Field.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Field();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.name = reader.string();
                    break;
                case 2:
                    message.type = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Field message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Field
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Field} Field
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Field.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Field message.
         * @function verify
         * @memberof pb.Field
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Field.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.type != null && message.hasOwnProperty("type"))
                if (!$util.isInteger(message.type))
                    return "type: integer expected";
            return null;
        };

        /**
         * Creates a Field message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Field
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Field} Field
         */
        Field.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Field)
                return object;
            let message = new $root.pb.Field();
            if (object.name != null)
                message.name = String(object.name);
            if (object.type != null)
                message.type = object.type | 0;
            return message;
        };

        /**
         * Creates a plain object from a Field message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Field
         * @static
         * @param {pb.Field} message Field
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Field.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.name = "";
                object.type = 0;
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = message.type;
            return object;
        };

        /**
         * Converts this Field to JSON.
         * @function toJSON
         * @memberof pb.Field
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Field.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Field;
    })();

    pb.Row = (function() {

        /**
         * Properties of a Row.
         * @memberof pb
         * @interface IRow
         * @property {Array.<Uint8Array>|null} [data] Row data
         */

        /**
         * Constructs a new Row.
         * @memberof pb
         * @classdesc Represents a Row.
         * @implements IRow
         * @constructor
         * @param {pb.IRow=} [properties] Properties to set
         */
        function Row(properties) {
            this.data = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Row data.
         * @member {Array.<Uint8Array>} data
         * @memberof pb.Row
         * @instance
         */
        Row.prototype.data = $util.emptyArray;

        /**
         * Creates a new Row instance using the specified properties.
         * @function create
         * @memberof pb.Row
         * @static
         * @param {pb.IRow=} [properties] Properties to set
         * @returns {pb.Row} Row instance
         */
        Row.create = function create(properties) {
            return new Row(properties);
        };

        /**
         * Encodes the specified Row message. Does not implicitly {@link pb.Row.verify|verify} messages.
         * @function encode
         * @memberof pb.Row
         * @static
         * @param {pb.IRow} message Row message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Row.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.data != null && message.data.length)
                for (let i = 0; i < message.data.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data[i]);
            return writer;
        };

        /**
         * Encodes the specified Row message, length delimited. Does not implicitly {@link pb.Row.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Row
         * @static
         * @param {pb.IRow} message Row message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Row.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Row message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Row
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Row} Row
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Row.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Row();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    if (!(message.data && message.data.length))
                        message.data = [];
                    message.data.push(reader.bytes());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Row message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Row
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Row} Row
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Row.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Row message.
         * @function verify
         * @memberof pb.Row
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Row.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.data != null && message.hasOwnProperty("data")) {
                if (!Array.isArray(message.data))
                    return "data: array expected";
                for (let i = 0; i < message.data.length; ++i)
                    if (!(message.data[i] && typeof message.data[i].length === "number" || $util.isString(message.data[i])))
                        return "data: buffer[] expected";
            }
            return null;
        };

        /**
         * Creates a Row message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Row
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Row} Row
         */
        Row.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Row)
                return object;
            let message = new $root.pb.Row();
            if (object.data) {
                if (!Array.isArray(object.data))
                    throw TypeError(".pb.Row.data: array expected");
                message.data = [];
                for (let i = 0; i < object.data.length; ++i)
                    if (typeof object.data[i] === "string")
                        $util.base64.decode(object.data[i], message.data[i] = $util.newBuffer($util.base64.length(object.data[i])), 0);
                    else if (object.data[i].length)
                        message.data[i] = object.data[i];
            }
            return message;
        };

        /**
         * Creates a plain object from a Row message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Row
         * @static
         * @param {pb.Row} message Row
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Row.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.data = [];
            if (message.data && message.data.length) {
                object.data = [];
                for (let j = 0; j < message.data.length; ++j)
                    object.data[j] = options.bytes === String ? $util.base64.encode(message.data[j], 0, message.data[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.data[j]) : message.data[j];
            }
            return object;
        };

        /**
         * Converts this Row to JSON.
         * @function toJSON
         * @memberof pb.Row
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Row.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Row;
    })();

    pb.Pass = (function() {

        /**
         * Properties of a Pass.
         * @memberof pb
         * @interface IPass
         * @property {Array.<string>|null} [prefix] Pass prefix
         * @property {Array.<string>|null} [contains] Pass contains
         */

        /**
         * Constructs a new Pass.
         * @memberof pb
         * @classdesc Represents a Pass.
         * @implements IPass
         * @constructor
         * @param {pb.IPass=} [properties] Properties to set
         */
        function Pass(properties) {
            this.prefix = [];
            this.contains = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Pass prefix.
         * @member {Array.<string>} prefix
         * @memberof pb.Pass
         * @instance
         */
        Pass.prototype.prefix = $util.emptyArray;

        /**
         * Pass contains.
         * @member {Array.<string>} contains
         * @memberof pb.Pass
         * @instance
         */
        Pass.prototype.contains = $util.emptyArray;

        /**
         * Creates a new Pass instance using the specified properties.
         * @function create
         * @memberof pb.Pass
         * @static
         * @param {pb.IPass=} [properties] Properties to set
         * @returns {pb.Pass} Pass instance
         */
        Pass.create = function create(properties) {
            return new Pass(properties);
        };

        /**
         * Encodes the specified Pass message. Does not implicitly {@link pb.Pass.verify|verify} messages.
         * @function encode
         * @memberof pb.Pass
         * @static
         * @param {pb.IPass} message Pass message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Pass.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.prefix != null && message.prefix.length)
                for (let i = 0; i < message.prefix.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.prefix[i]);
            if (message.contains != null && message.contains.length)
                for (let i = 0; i < message.contains.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.contains[i]);
            return writer;
        };

        /**
         * Encodes the specified Pass message, length delimited. Does not implicitly {@link pb.Pass.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Pass
         * @static
         * @param {pb.IPass} message Pass message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Pass.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Pass message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Pass
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Pass} Pass
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Pass.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Pass();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    if (!(message.prefix && message.prefix.length))
                        message.prefix = [];
                    message.prefix.push(reader.string());
                    break;
                case 2:
                    if (!(message.contains && message.contains.length))
                        message.contains = [];
                    message.contains.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Pass message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Pass
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Pass} Pass
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Pass.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Pass message.
         * @function verify
         * @memberof pb.Pass
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Pass.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.prefix != null && message.hasOwnProperty("prefix")) {
                if (!Array.isArray(message.prefix))
                    return "prefix: array expected";
                for (let i = 0; i < message.prefix.length; ++i)
                    if (!$util.isString(message.prefix[i]))
                        return "prefix: string[] expected";
            }
            if (message.contains != null && message.hasOwnProperty("contains")) {
                if (!Array.isArray(message.contains))
                    return "contains: array expected";
                for (let i = 0; i < message.contains.length; ++i)
                    if (!$util.isString(message.contains[i]))
                        return "contains: string[] expected";
            }
            return null;
        };

        /**
         * Creates a Pass message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Pass
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Pass} Pass
         */
        Pass.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Pass)
                return object;
            let message = new $root.pb.Pass();
            if (object.prefix) {
                if (!Array.isArray(object.prefix))
                    throw TypeError(".pb.Pass.prefix: array expected");
                message.prefix = [];
                for (let i = 0; i < object.prefix.length; ++i)
                    message.prefix[i] = String(object.prefix[i]);
            }
            if (object.contains) {
                if (!Array.isArray(object.contains))
                    throw TypeError(".pb.Pass.contains: array expected");
                message.contains = [];
                for (let i = 0; i < object.contains.length; ++i)
                    message.contains[i] = String(object.contains[i]);
            }
            return message;
        };

        /**
         * Creates a plain object from a Pass message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Pass
         * @static
         * @param {pb.Pass} message Pass
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Pass.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.prefix = [];
                object.contains = [];
            }
            if (message.prefix && message.prefix.length) {
                object.prefix = [];
                for (let j = 0; j < message.prefix.length; ++j)
                    object.prefix[j] = message.prefix[j];
            }
            if (message.contains && message.contains.length) {
                object.contains = [];
                for (let j = 0; j < message.contains.length; ++j)
                    object.contains[j] = message.contains[j];
            }
            return object;
        };

        /**
         * Converts this Pass to JSON.
         * @function toJSON
         * @memberof pb.Pass
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Pass.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Pass;
    })();

    pb.User = (function() {

        /**
         * Properties of a User.
         * @memberof pb
         * @interface IUser
         * @property {string|null} [user] User user
         * @property {string|null} [password] User password
         * @property {boolean|null} [readonly] User readonly
         * @property {boolean|null} [log] User log
         */

        /**
         * Constructs a new User.
         * @memberof pb
         * @classdesc Represents a User.
         * @implements IUser
         * @constructor
         * @param {pb.IUser=} [properties] Properties to set
         */
        function User(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * User user.
         * @member {string} user
         * @memberof pb.User
         * @instance
         */
        User.prototype.user = "";

        /**
         * User password.
         * @member {string} password
         * @memberof pb.User
         * @instance
         */
        User.prototype.password = "";

        /**
         * User readonly.
         * @member {boolean} readonly
         * @memberof pb.User
         * @instance
         */
        User.prototype.readonly = false;

        /**
         * User log.
         * @member {boolean} log
         * @memberof pb.User
         * @instance
         */
        User.prototype.log = false;

        /**
         * Creates a new User instance using the specified properties.
         * @function create
         * @memberof pb.User
         * @static
         * @param {pb.IUser=} [properties] Properties to set
         * @returns {pb.User} User instance
         */
        User.create = function create(properties) {
            return new User(properties);
        };

        /**
         * Encodes the specified User message. Does not implicitly {@link pb.User.verify|verify} messages.
         * @function encode
         * @memberof pb.User
         * @static
         * @param {pb.IUser} message User message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        User.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.user != null && Object.hasOwnProperty.call(message, "user"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.user);
            if (message.password != null && Object.hasOwnProperty.call(message, "password"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.password);
            if (message.readonly != null && Object.hasOwnProperty.call(message, "readonly"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.readonly);
            if (message.log != null && Object.hasOwnProperty.call(message, "log"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.log);
            return writer;
        };

        /**
         * Encodes the specified User message, length delimited. Does not implicitly {@link pb.User.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.User
         * @static
         * @param {pb.IUser} message User message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        User.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a User message from the specified reader or buffer.
         * @function decode
         * @memberof pb.User
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.User} User
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        User.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.User();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.user = reader.string();
                    break;
                case 2:
                    message.password = reader.string();
                    break;
                case 3:
                    message.readonly = reader.bool();
                    break;
                case 4:
                    message.log = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a User message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.User
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.User} User
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        User.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a User message.
         * @function verify
         * @memberof pb.User
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        User.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.user != null && message.hasOwnProperty("user"))
                if (!$util.isString(message.user))
                    return "user: string expected";
            if (message.password != null && message.hasOwnProperty("password"))
                if (!$util.isString(message.password))
                    return "password: string expected";
            if (message.readonly != null && message.hasOwnProperty("readonly"))
                if (typeof message.readonly !== "boolean")
                    return "readonly: boolean expected";
            if (message.log != null && message.hasOwnProperty("log"))
                if (typeof message.log !== "boolean")
                    return "log: boolean expected";
            return null;
        };

        /**
         * Creates a User message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.User
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.User} User
         */
        User.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.User)
                return object;
            let message = new $root.pb.User();
            if (object.user != null)
                message.user = String(object.user);
            if (object.password != null)
                message.password = String(object.password);
            if (object.readonly != null)
                message.readonly = Boolean(object.readonly);
            if (object.log != null)
                message.log = Boolean(object.log);
            return message;
        };

        /**
         * Creates a plain object from a User message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.User
         * @static
         * @param {pb.User} message User
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        User.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.user = "";
                object.password = "";
                object.readonly = false;
                object.log = false;
            }
            if (message.user != null && message.hasOwnProperty("user"))
                object.user = message.user;
            if (message.password != null && message.hasOwnProperty("password"))
                object.password = message.password;
            if (message.readonly != null && message.hasOwnProperty("readonly"))
                object.readonly = message.readonly;
            if (message.log != null && message.hasOwnProperty("log"))
                object.log = message.log;
            return object;
        };

        /**
         * Converts this User to JSON.
         * @function toJSON
         * @memberof pb.User
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        User.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return User;
    })();

    return pb;
})();

export { $root as default };
